<%
layout("/include/_dialog.html"){
%>
<script type="text/javascript">
    function save() {
        var isValidate = jp.validateForm('#inputForm');//校验表单
        if (!isValidate) {
            return false;
        } else {
            jp.loading('  正在导入，请稍等...');
            var importForm = $("#inputForm")[0];
            jp.uploadFile(importForm, "${ctx}/act/process/deploy", function (data) {
                if (data.success) {
                    jp.getParent().refresh();
                    var dialogIndex = parent.layer.getFrameIndex(window.name); // 获取窗口索引
                    parent.layer.close(dialogIndex);
                    jp.success(data.msg)

                } else {
                    jp.error(data.msg);
                }
            })
        }

    }
</script>
    <form id="inputForm" method="post" enctype="multipart/form-data" class="form-horizontal p-15">
        <div class="form-group row">
            <label class="col-sm-2 control-label">流程分类：</label>
            <div class="col-sm-10">
                <#select path="category" items="${fn.getDictList('act_category')}" itemLabel="label" itemValue="value"
                />
            </div>
        </div>
        <div class="form-group row">
            <label class="col-sm-2 control-label">流程文件：</label>
            <div class="col-sm-10">
                <input type="file" id="file" name="file" class="required form-control"/>
                <span class="text-muted"><small>支持文件格式：zip、bar、bpmn、bpmn20.xml</small></span>
            </div>
        </div>
    </form>

<% } %>
